<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>title</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../css/aui.css"/>
		<link rel="stylesheet" type="text/css" href="../css/record.css"/>
		<style>
			body {
			}
		</style>
	</head>
	<body>
		<header class="aui-bar aui-bar-nav" style="padding-top:5px;">
			<a class="aui-pull-left" id="return"> <span class="aui-iconfont aui-icon-left">取消</span> </a>
			<div class="aui-title">
				测试成绩
			</div>
			<a class="aui-pull-right aui-btn aui-btn-outlined" id="save"> 保存 </a>
		</header>
		<div class="container">
			<div class="table-cell">
				<div class="label">跳远距离</div>
				<div class="input-area">
					<input type="number" placeholder="厘米（cm）" id="achiev" autofocus>
				</div>
			</div>
		</div>
		<!--<ul class="aui-list aui-form-list">-->
			<!--<li class="aui-list-item">-->
				<!--<input type="text" value="跳远距离"  id="reg" readonly="true"/>-->
				<!--<input type="text" placeholder="输入距离"  id="achiev" />-->
			<!--</li>-->
		<!--</ul>-->
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/common.js"></script>
	<script type="text/javascript" src="../script/aui-dialog.js"></script>
	<script type="text/javascript">
		apiready = function() {
			var dialog = new auiDialog({})
			var _return = $api.byId('return');
			var _save = $api.byId('save');
			$api.addEvt(_return, 'click', function() {
				api.closeWin({
					name : 'record'
				});
			});
			$api.addEvt(_save, 'click', function() {
				var _achiev = document.getElementById("achiev").value;
				alert(_achiev);
				if (_achiev == "") {
					dialog.alert({
						title : "错误",
						msg : "距离不能为空",
						buttons : ['确定']
					})
					return false;
				} else {
					dialog.alert({
						title : "成功",
						msg : '记录成功',
						buttons : ['确定']
					}, function(ret) {
						if (ret) {
							api.openWin({
								name : 'duoxing',
								url : './duoxing.html',
							});
						}
					})
				}
			});
		};
	</script>
</html>